package com.wen.control;

import com.wen.service.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import com.wen.bean.UserInfoBean;

import javax.annotation.Resource;
//分层


public class LoginControl {
    //使用spring 注解配置方式进行依赖注入
    @Autowired
    UserInfoBean userInfoBean;
    @Resource
    ILoginService loginService;

    /**
     * 进行登录处理
     *
     * @return 登录结果
     */
    public boolean doLogin() {
        boolean canLogined = false;
        //进行登录业务处理
        canLogined = loginService.doLogin(userInfoBean);
        System.out.println("----------------------");
        loginService.doSleeping();
        return canLogined;
    }

    public UserInfoBean getUserInfoBean() {
        return userInfoBean;
    }

    public void setUserInfoBean(UserInfoBean userInfoBean) {
        this.userInfoBean = userInfoBean;
    }

    public ILoginService getLoginService() {
        return loginService;
    }

    public void setLoginService(ILoginService loginService) {
        this.loginService = loginService;
    }
}
